package com.ysm.smfu.adapter;

import android.content.Intent;
import android.widget.ListView;

import com.ysm.smfu.activity.FoundActivity;
import com.ysm.smfu.bean.HomeProduct;
import com.ysm.smfu.holder.BaseHolder;
import com.ysm.smfu.protocal.BaseProtocal;
import com.ysm.smfu.protocal.MyStringCallBack;
import com.ysm.smfu.utils.UIUtils;

import org.json.JSONException;
import org.json.JSONObject;

import java.util.List;

/**
 * Created by Administrator on 2017/4/17.
 */
public class HomeProductAdapter extends DefaultAdapter<HomeProduct.Goods> {

    public HomeProductAdapter(List<HomeProduct.Goods> datas, ListView listView, Object object) {
        super(datas, listView, object);
    }

    @Override
    protected BaseHolder<HomeProduct.Goods> getHolder() {
        return new HomeProductHolder(object);
    }

    @Override
    protected void onInnerItemClick(final int position) {
        if (position >= datas.size())
            return;
        Intent intent = new Intent(UIUtils.getContext(), FoundActivity.class);
        intent.putExtra("found", 16);
        intent.putExtra("goodsId", datas.get(position).id);
        UIUtils.startActivity(intent);
    }

}
